
// 点巡检计划
import qs from 'qs'
import request from "@/utils/request"

/**
 *GET 获取代办
  * @params
 * @return {*}
 */
export function getBacklogList(deviceId) {
  return request({
    url: "/task/getBacklogList?deviceId=" + deviceId,
    method: "get"
  });
}
/**
 *GET 获取当前用户点巡检任务
  * @params
 * @return {*}
 */
export function getCurrentUserList(params) {
  return request({
    url: "/spotInspectionPlan/getCurrentUserList?" + qs.stringify(params),
    method: "get"
  });
}
/**
 *GET 获取点巡检计划列表
  * @params

 * @return {*}
 */
export function getSpotInspectionPlanList(params) {
  return request({
    url: "/spotInspectionPlan/getList?" + qs.stringify(params),
    method: "get",
  })
}
/**
 *GET 通过点巡检计划获取设备
  * @params

 * @return {*}
 */
export function getSpotInspectionPlanByPlanId(planId) {
  return request({
    url: "/spotInspectionPlan/getSpotInspectionDeviceByPlanId?planId=" + planId,
    method: "get",
  })
}
/**
 *GET 获取点巡检计划详情
  * @params

 * @return {*}
 */
export function getSpotInspectionPlanInfo(id) {
  return request({
    url: "/spotInspectionPlan/getInfo?id=" + id,
    method: "get",
  })
}
/**
 *GET 获取点巡检计划所有数据
  * @params
 * @return {*}
 */
export function getPlanAll(id) {
  return request({
    url: "/spotInspectionPlan/getAll?id=" + id,
    method: "get",
  })
}


/**
 * 新增点巡检计划
 * @return {*}
 */
export function addSpotInspectionPlan(data) {
  return request({
    url: "/spotInspectionPlan/add",
    method: "post",
    data
  })
}

/**
 * 修改点巡检计划
 * @return {*}
 */
export function updateSpotInspectionPlan(data) {
  return request({
    url: "/spotInspectionPlan/update",
    method: "post",
    data
  })
}
/**
 * 更新点巡检计划状态
 * @return {*}
 */
export function updateStateSpotInspectionPlan(data) {
  return request({
    url: "/spotInspectionPlan/updateState",
    method: "post",
    data
  })
}

/**
 * 删除点巡检计划
 * @return {*}
 */
export function deleteSpotInspectionPlanById(id) {
  return request({
    url: "/spotInspectionPlan/delete?id=" + id,
    method: "delete",
  })
}
